import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '部门名称',
    align:"center",
    dataIndex: 'deptName'
   },
   {
    title: '总人数',
    align:"center",
    dataIndex: 'cnt'
   },
   {
    title: '授权成功人数',
    align:"center",
    dataIndex: 'status1'
   },
   {
    title: '授权失败人数',
    align:"center",
    dataIndex: 'status0'
   },
   {
    title: '照片不存在人数',
    align:"center",
    dataIndex: 'photo'
   }, 
   {
    title: '照片不合格数',
    align:"center",
    dataIndex: 'status3'
   },
];
//列表数据
export const totalColumns: BasicColumn[] = [
   {
    title: '部门名称',
    align:"center",
    dataIndex: 'personDepartmentName'
   },
   {
    title: '进入人数',
    align:"center",
    dataIndex: 'addrName'
   },
   {
    title: '出去人数',
    align:"center",
    dataIndex: 'temperature'
   },
  
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "部门",
      field: 'departmentId',
      component: 'JSelectDept',
      componentProps:{
        multiple:false,
        checkable:false,
      },
      //colProps: {span: 6},
 	},
  //    {
  //     label: "授权时间",
  //     field: "accessDate",
  //     component: 'RangePicker',
  //     componentProps: {
  //         valueType: 'Date',
  //     },
  //     //colProps: {span: 6},
	// },
];

//查询数据
export const searchFormSchemaTotal: FormSchema[] = [
	{
      label: "部门",
      field: 'personDepartmentId',
      component: 'JSelectDept',
      componentProps:{
        multiple:false,
        checkable:false,
      },
      dynamicRules: ({model,schema}) => {
            return [
                  // { message: '请选择部门!'},
            ];
      },
      //colProps: {span: 6},
 	},
	// {
  //     label: "设备序列号",
  //     field: 'deviceSn',
  //     component: 'Input',
  //     //colProps: {span: 6},
 	// },
	{
      label: "设备名称",
      field: 'deviceName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "刷卡方式",
      field: 'accessMethod',
      component: 'JDictSelectTag',
      componentProps:{
        dictCode:'accessMethod',
      },
      //colProps: {span: 6},
 	},
	// {
  //     label: "刷卡卡号",
  //     field: 'cardNo',
  //     component: 'Input',
  //     //colProps: {span: 6},
 	// },
     {
      label: "通行时间",
      field: "accessDate",
      component: 'RangePicker',
      componentProps: {
          valueType: 'Date',
      },
      //colProps: {span: 6},
	},
	// {
  //     label: "是否离线",
  //     field: 'isOfflineSeed',
  //     component: 'Input',
  //     //colProps: {span: 6},
 	// },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '人员id',
    field: 'personId',
    component: 'Input',
  },
  {
    label: '学/工号',
    field: 'personCode',
    component: 'Input',
  },
  {
    label: '姓名',
    field: 'personName',
    component: 'Input',
  },
  {
    label: '部门id',
    field: 'personDepartmentId',
    component: 'Input',
  },
  {
    label: '部门名称',
    field: 'personDepartmentName',
    component: 'Input',
  },
  {
    label: '设备id',
    field: 'deviceId',
    component: 'InputNumber',
  },
  {
    label: '设备序列号',
    field: 'deviceSn',
    component: 'Input',
  },
  {
    label: '设备名称',
    field: 'deviceName',
    component: 'Input',
  },
  {
    label: '预留',
    field: 'addrName',
    component: 'Input',
  },
  {
    label: '刷卡方式',
    field: 'accessMethod',
    component: 'Input',
  },
  {
    label: '刷卡卡号',
    field: 'cardNo',
    component: 'Input',
  },
  {
    label: '图像抓拍',
    field: 'snapLink',
    component: 'Input',
  },
  {
    label: '通行时间',
    field: 'accessDate',
    component: 'DatePicker',
  },
  {
    label: '通行序号',
    field: 'passingNo',
    component: 'Input',
  },
  {
    label: '是否离线',
    field: 'isOfflineSeed',
    component: 'Input',
  },
  {
    label: '上送时间',
    field: 'seedDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '体温',
    field: 'temperature',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  personId: {title: '人员id',order: 0,view: 'text', type: 'string',},
  personCode: {title: '学/工号',order: 1,view: 'text', type: 'string',},
  personName: {title: '姓名',order: 2,view: 'text', type: 'string',},
  personDepartmentId: {title: '部门id',order: 3,view: 'text', type: 'string',},
  personDepartmentName: {title: '部门名称',order: 4,view: 'text', type: 'string',},
  deviceId: {title: '设备id',order: 5,view: 'number', type: 'number',},
  deviceSn: {title: '设备序列号',order: 6,view: 'text', type: 'string',},
  deviceName: {title: '设备名称',order: 7,view: 'text', type: 'string',},
  addrName: {title: '预留',order: 8,view: 'text', type: 'string',},
  accessMethod: {title: '刷卡方式',order: 9,view: 'text', type: 'string',},
  cardNo: {title: '刷卡卡号',order: 10,view: 'text', type: 'string',},
  snapLink: {title: '图像抓拍',order: 11,view: 'text', type: 'string',},
  accessDate: {title: '通行时间',order: 12,view: 'date', type: 'string',},
  passingNo: {title: '通行序号',order: 13,view: 'text', type: 'string',},
  isOfflineSeed: {title: '是否离线',order: 14,view: 'text', type: 'string',},
  seedDate: {title: '上送时间',order: 15,view: 'datetime', type: 'string',},
  temperature: {title: '体温',order: 16,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
